package com.bgIntlgn.client.entity.manufacture;

import java.util.Date;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 派工于生产记录
 * 
 * @author yuhui
 * 
 */

@Table(name = "work_recods", constrain = "")
public class WorkRecord implements Bean {

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('work_recods_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key")
	private Long id;

	@Field(name = "serial_number", type = "varchar(80)", constrain = "unique")
	private String serialNumber;

	/**
	 * 对应的生产条目
	 */
	@Field(name = "production_iterm_id", type = "int8 ", constrain = " not null references production_iterms(id)  on update cascade ")
	private Long productionItermId;

	/**
	 * 对应的工序。
	 */
	@Field(name = "work_procedure_id", type = "int8 ", constrain = " not null references work_procedures(id)  on update cascade ")
	private Long workProcedureId;

	/**
	 * 待生产数量, 即是派工数量.
	 */
	@Field(name = "plan_quantity", type = "int", constrain = "not null default 0")
	private Integer planQuantity;

	/**
	 * 合格数量, 此处由质检输入。
	 */
	@Field(name = "produced_quantity", type = "int", constrain = "not null default 0")
	private Integer producedQuantity;

	/**
	 * 开始时间
	 */
	@Field(name = "start_date", type = "date", constrain = "")
	private Date startDate;

	/**
	 * 派工时填写的计划结束最后时间
	 */
	@Field(name = "dead_line", type = "timestamp", constrain = "")
	private Date deadLine;

	/**
	 * 生产人员
	 */
	@Field(name = "producer", type = "int8", constrain = "not null references employees(id)  on update cascade ")
	private Long producer;

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getProductionItermId() {
		return this.productionItermId;
	}

	public void setProductionItermId(Long productionItermId) {
		this.productionItermId = productionItermId;
	}

	public Integer getPlanQuantity() {
		return this.planQuantity;
	}

	public void setPlanQuantity(Integer planQuantity) {
		this.planQuantity = planQuantity;
	}

	public Integer getProducedQuantity() {
		return this.producedQuantity;
	}

	public void setProducedQuantity(Integer producedQuantity) {
		this.producedQuantity = producedQuantity;
	}

	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Long getProducer() {
		return this.producer;
	}

	public void setProducer(Long producer) {
		this.producer = producer;
	}

	public Long getWorkProcedureId() {
		return this.workProcedureId;
	}

	public void setWorkProcedureId(Long workProcedureId) {
		this.workProcedureId = workProcedureId;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public Date getDeadLine() {
		return deadLine;
	}

	public void setDeadLine(Date deadLine) {
		this.deadLine = deadLine;
	}

}
